package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcClassAttach;
import com.visizen.wisdomclass.server.model.WcClassAttachExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcClassAttachMapper {
    @SelectProvider(type=WcClassAttachSqlProvider.class, method="countByExample")
    int countByExample(WcClassAttachExample example);

    @DeleteProvider(type=WcClassAttachSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcClassAttachExample example);

    @Delete({
        "delete from wc_class_attach",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_class_attach (ID, MESS_ID, ",
        "ATTACH_ID)",
        "values (#{ID,jdbcType=BIGINT}, #{MESS_ID,jdbcType=BIGINT}, ",
        "#{ATTACH_ID,jdbcType=BIGINT})"
    })
    int insert(WcClassAttach record);

    @InsertProvider(type=WcClassAttachSqlProvider.class, method="insertSelective")
    int insertSelective(WcClassAttach record);

    @SelectProvider(type=WcClassAttachSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="MESS_ID", property="MESS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="ATTACH_ID", property="ATTACH_ID", jdbcType=JdbcType.BIGINT)
    })
    List<WcClassAttach> selectByExample(WcClassAttachExample example);

    @Select({
        "select",
        "ID, MESS_ID, ATTACH_ID",
        "from wc_class_attach",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="MESS_ID", property="MESS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="ATTACH_ID", property="ATTACH_ID", jdbcType=JdbcType.BIGINT)
    })
    WcClassAttach selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcClassAttachSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcClassAttach record, @Param("example") WcClassAttachExample example);

    @UpdateProvider(type=WcClassAttachSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcClassAttach record, @Param("example") WcClassAttachExample example);

    @UpdateProvider(type=WcClassAttachSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcClassAttach record);

    @Update({
        "update wc_class_attach",
        "set MESS_ID = #{MESS_ID,jdbcType=BIGINT},",
          "ATTACH_ID = #{ATTACH_ID,jdbcType=BIGINT}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcClassAttach record);
}